/***************************************************************************
 *   Copyleft 2006-2007 by												   *
 *	 Iwanicki Krzysztof													   *
 *   <gamma.mini.pw.edu.pl/~iwanickik>			                           *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 ***************************************************************************/
#ifndef __COLOR_H__
#define __COLOR_H__

#include "../../Types/Types.h"

class Color {
public:
	union {
		struct {
			cFloat mValues[4];
		};
		struct {
			cFloat mR;
			cFloat mG;
			cFloat mB;
			cFloat mA;
		};
	};

	/**************************************************************
    * Constructors                                                *
    ***************************************************************/
	Color(): mR(0.0f), mG(0.0f), mB(0.0f), mA(0.0f) { }
	Color(cFloat fR, cFloat fG, cFloat fB): mR(fR), mG(fG), mB(fB), mA(0.0f) { }
	Color(cFloat fR, cFloat fG, cFloat fB, cFloat fA): mR(fR), mG(fG), mB(fB), mA(fA) { }
	Color(const Color& color);

	/**************************************************************
    * Operators                                                   *
    ***************************************************************/
	Color& operator+=(const Color& colorB);
	Color& operator-=(const Color& colorB);
	Color operator-() const;
	Color& operator*=(const Color& colorB);
	Color& operator*=(const cFloat fFactor);
	Color& operator=(const Color& colorB);	
	Color operator*(const cFloat fFactor);

	/**************************************************************
    * Helpful functions                                           *
    ***************************************************************/
	inline cVoid ClipComponents();
	inline cVoid PositiveClipComponents();
	static cWinColor ToWinColor(const Color& color);
	static Color Red();
	static Color Green();
	static Color Blue();
	static Color White();
	static Color Black();
};


#define RED					(Color::Red())
#define GREEN				(Color::Green())
#define BLUE				(Color::Blue())
#define WHITE				(Color::White())
#define BLACK				(Color::Black())


#endif //__COLOR_H__